package cn.jc.springframework.context.support;

import cn.jc.springframework.beans.factory.support.DefaultListableBeanFactory;
import cn.jc.springframework.beans.factory.xml.XmlBeanDefinitionReader;

/**
 * @Description:
 * @author: JC
 * @date: 2023/4/6 18:29
 */
public abstract class AbstractXmlApplicationContext extends AbstractRefreshableApplicationContext{

    @Override
    protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
        XmlBeanDefinitionReader beanDefinitionReader = new XmlBeanDefinitionReader(beanFactory, this);
        String[] configLocations = getConfigLocations();
        if(configLocations != null){
            beanDefinitionReader.loadBeanDefinitions(configLocations);
        }
    }

    protected abstract String[] getConfigLocations();

}
